package com.lanjiyin.cloud.common.msg;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

import com.lanjiyin.cloud.common.constant.RestCodeConstants;

/**
 * 响应数据
 * @author: JACK.LIN 
 * @date:   2020年5月24日 下午11:59:38   
 * @param <T>
 */
@ApiModel(value = "响应数据")
public class Result<T> implements Serializable {
    private static final long serialVersionUID = 1L;
    public Result() {
    }
    public Result(int code, String message) {
        this.code = code;
        this.message = message;
    }
    public Result(int code, String message, String tag) {
        this.code = code;
        this.message = message;
        this.tag = tag;
    }
    public Result(int code, String message, String tag, T data) {
        this.code = code;
        this.message = message;
        this.tag = tag;
        this.data = data;
    }
    public Result(T data) {
        this.data = data;
    }
    /**
     * 业务状态编码
     */
    @ApiModelProperty(value = "编码：200表示成功")
    private int code = RestCodeConstants.SUCCESS_CODE;
    /**
     * 消息内容
     */
    @ApiModelProperty(value = "消息内容")
    private String message = "success";
    /**
     * 消息标识
     */
    @ApiModelProperty(value = "消息标识(未使用)")
    private String tag;
    /**
     * 响应数据
     */
    @ApiModelProperty(value = "响应数据")
    private T data;

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getTag() {
		return tag;
	}

	public void setTag(String tag) {
		this.tag = tag;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}
    
}
